'use strict';

module.exports = app => {
  const { STRING, INTEGER, DATE } = app.Sequelize;

  const sys_dict_type = app.model.define('sys_dict_type', {
    dictId: {
      type: INTEGER(20),
      comment: "字典主键",
      allowNull: false,
      primaryKey: true,
      field:"dict_id",
      autoIncrement: true
    },
    dictName: {
      type: STRING(100),
      comment: "字典名称",
      field:'dict_name',
      defaultValue: ""
    },
    dictType: {
      type: STRING(100),
      comment: "字典类型",
      field:"dict_type",
      defaultValue: ""
    },
    status: {
      type: STRING(1),
      comment: "状态（0正常 1停用）",
      defaultValue: "0"
    },
    createBy: {
      type: STRING(64),
      comment: "创建者",
      defaultValue: "",
      field:"create_by"
    },
    updateBy: {
      type: STRING(64),
      comment: "更新者",
      defaultValue: "",
      field:"update_by"
    },
    remark: {
      type: STRING(500),
      comment: "备注",
      defaultValue: ""
    },
    createTime:{
      type:DATE,
      field:"created_at"
    }
  }, {
    // deleteAt:false,
    freezeTableName: true
  });

  return sys_dict_type;
};